package com.jiyinit.web.core.mobile.controller;

import com.alibaba.fastjson.JSONObject;
import com.jiyinit.core.framework.base.entity.ResponseDto;
import com.jiyinit.core.framework.base.paging.PagingResult;
import com.jiyinit.core.framework.base.util.AESUtil;
import com.jiyinit.core.framework.base.util.Check;
import com.jiyinit.core.framework.base.util.JsonEntityTransform;
import com.jiyinit.core.framework.base.util.LogUtil;
import com.jiyinit.web.core.business.dto.UserRequest;
import com.jiyinit.web.core.business.dto.UserSalaryRequest;
import com.jiyinit.web.core.business.entity.TabCoreUserEntity;
import com.jiyinit.web.core.business.entity.TabCoreUserSalaryEntity;
import com.jiyinit.web.core.business.service.UserSalaryServiceImpl;
import com.jiyinit.web.core.business.service.UserServiceImpl;
import com.jiyinit.web.core.common.util.GlobalsUtils;
import com.jiyinit.web.core.common.util.UserUtil;
import com.jiyinit.web.core.common.vo.CurrentUserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;


/**
 * Created By Lichangqin
 * Date : 2019/1/8
 */
@Controller
@RequestMapping(value = "/mobile/userSalary")
public class MuserSalaryController {

    private static Logger logger = LoggerFactory.getLogger(MuserSalaryController.class);

    @Resource(name = "core.userSalaryServiceImpl")
    private UserSalaryServiceImpl userSalaryService;

    @Resource(name = "core.userServiceImpl")
    private UserServiceImpl userService;

    /**
     * 分页查询
     * @param req
     * @param request_json
     * @return
     */
	@ResponseBody
	@RequestMapping(value = "/getPageRows")
	public ResponseEntity<ResponseDto> getPageRows(HttpServletRequest req, String request_json){
		UserSalaryRequest request = JsonEntityTransform.json2Object(request_json, UserSalaryRequest.class);
//		request.setLimit(10);
//        Integer userId=request.getUserId();
        TabCoreUserEntity coreUserEntity=userService.getUserInfoByUserId(request.getUserId());
        String salarySecretKey=coreUserEntity.getSalarySecretKey();
        String random=AESUtil.decrypt(salarySecretKey);
        request.setUserCertificateNo(AESUtil.encrypt(random,coreUserEntity.getUserCertificateNo()));
		PagingResult<TabCoreUserSalaryEntity> pag = userSalaryService.findForPage(request);

        List<TabCoreUserSalaryEntity> list=pag.getRows();
        for (int i=0;i<list.size();i++){
            String userCertificateNo=list.get(i).getUserCertificateNo();
            String salaryMonth=list.get(i).getSalaryMonth();
            String entryDate=list.get(i).getEntryDate();
            String positionSalary=list.get(i).getPositionSalary();
            String meritSalary=list.get(i).getMeritSalary();
            String positionAllowance=list.get(i).getPositionAllowance();
            String awardSalary=list.get(i).getAwardSalary();
            String agreedSalary=list.get(i).getAgreedSalary();
            String computerAllowance=list.get(i).getComputerAllowance();
            String mealAllowance=list.get(i).getMealAllowance();
            String recommendAward=list.get(i).getRecommendAward();
            String evectionAllowance=list.get(i).getEvectionAllowance();
            String reissueSalary=list.get(i).getReissueSalary();
            String overtimeAllowance=list.get(i).getOvertimeAllowance();
            String leaveDeduct=list.get(i).getLeaveDeduct();
            String sunShine=list.get(i).getSunShine();
            String otherAllowance=list.get(i).getOtherAllowance();
            String totalSalary=list.get(i).getTotalSalary();
            String companyTotalInsuranceFund=list.get(i).getCompanyTotalInsuranceFund();
            String companyEndowment=list.get(i).getCompanyEndowment();
            String companyMedicalInsurance=list.get(i).getCompanyMedicalInsurance();
            String companyUnemployedInsurance=list.get(i).getCompanyUnemployedInsurance();
            String companyWoundInsurance=list.get(i).getCompanyWoundInsurance();
            String companyMaternityInsurance=list.get(i).getCompanyMaternityInsurance();
            String companyAccumulationFund=list.get(i).getCompanyAccumulationFund();
            String companyMajorDiseaseRisk=list.get(i).getCompanyMajorDiseaseRisk();
            String personalTotalInsuranceFund=list.get(i).getPersonalTotalInsuranceFund();
            String personalEndowment=list.get(i).getPersonalEndowment();
            String personalMedicalInsurance=list.get(i).getPersonalMedicalInsurance();
            String personalUnemployedInsurance=list.get(i).getPersonalUnemployedInsurance();
            String personalAccumulationFund=list.get(i).getPersonalAccumulationFund();
            String personalMajorDiseaseRisk=list.get(i).getPersonalMajorDiseaseRisk();
            String paidAward=list.get(i).getPaidAward();
            String specialDeductionOfPersonalIncomeTax=list.get(i).getSpecialDeductionOfPersonalIncomeTax();
            String taxableAmount=list.get(i).getTaxableAmount();
            String personalTax=list.get(i).getPersonalTax();
            String actualPaidSalary=list.get(i).getActualPaidSalary();
            String overtimePay = list.get(i).getOvertimePay();
            String deductionAmount = list.get(i).getDeductionAmount();

            //判断非空后解密
            if (!Check.isNullStr(userCertificateNo)){
                String userCertificateNo1=AESUtil.decrypt(random, userCertificateNo);
                list.get(i).setUserCertificateNo(userCertificateNo1);
            }
            if (!Check.isNullStr(salaryMonth)){
                String salaryMonth1=AESUtil.decrypt(random, salaryMonth);
                list.get(i).setSalaryMonth(salaryMonth1);
            }
            if (!Check.isNullStr(entryDate)){
                String entryDate1=AESUtil.decrypt(random, entryDate);
                list.get(i).setEntryDate(entryDate1);
            }
            if (!Check.isNullStr(positionSalary)){
                String positionSalary1=AESUtil.decrypt(random, positionSalary);
                list.get(i).setPositionSalary(positionSalary1);
            }
            if (!Check.isNullStr(meritSalary)){
                String meritSalary1=AESUtil.decrypt(random, meritSalary);
                list.get(i).setMeritSalary(meritSalary1);
            }
            if (!Check.isNullStr(positionAllowance)){
                String positionAllowance1=AESUtil.decrypt(random, positionAllowance);
                list.get(i).setPositionAllowance(positionAllowance1);
            }
            if (!Check.isNullStr(awardSalary)){
                String awardSalary1=AESUtil.decrypt(random, awardSalary);
                list.get(i).setAwardSalary(awardSalary1);
            }
            if (!Check.isNullStr(agreedSalary)){
                String agreedSalary1=AESUtil.decrypt(random, agreedSalary);
                list.get(i).setAgreedSalary(agreedSalary1);
            }
            if (!Check.isNullStr(computerAllowance)){
                String computerAllowance1=AESUtil.decrypt(random, computerAllowance);
                list.get(i).setComputerAllowance(computerAllowance1);
            }
            if (!Check.isNullStr(mealAllowance)){
                String mealAllowance1=AESUtil.decrypt(random, mealAllowance);
                list.get(i).setMealAllowance(mealAllowance1);
            }
            if (!Check.isNullStr(recommendAward)){
                String recommendAward1=AESUtil.decrypt(random, recommendAward);
                list.get(i).setRecommendAward(recommendAward1);
            }
            if (!Check.isNullStr(evectionAllowance)){
                String evectionAllowance1=AESUtil.decrypt(random, evectionAllowance);
                list.get(i).setEvectionAllowance(evectionAllowance1);
            }
            if (!Check.isNullStr(reissueSalary)){
                String reissueSalary1=AESUtil.decrypt(random, reissueSalary);
                list.get(i).setReissueSalary(reissueSalary1);
            }
            if (!Check.isNullStr(overtimeAllowance)){
                String overtimeAllowance1=AESUtil.decrypt(random, overtimeAllowance);
                list.get(i).setOvertimeAllowance(overtimeAllowance1);
            }
            if (!Check.isNullStr(leaveDeduct)){
                String leaveDeduct1=AESUtil.decrypt(random, leaveDeduct);
                list.get(i).setLeaveDeduct(leaveDeduct1);
            }
            if (!Check.isNullStr(sunShine)){
                String sunShine1=AESUtil.decrypt(random, sunShine);
                list.get(i).setSunShine(sunShine1);
            }
            if (!Check.isNullStr(otherAllowance)){
                String otherAllowance1=AESUtil.decrypt(random, otherAllowance);
                list.get(i).setOtherAllowance(otherAllowance1);
            }
            if (!Check.isNullStr(totalSalary)){
                String totalSalary1=AESUtil.decrypt(random, totalSalary);
                list.get(i).setTotalSalary(totalSalary1);
            }
            if (!Check.isNullStr(companyTotalInsuranceFund)){
                String companyTotalInsuranceFund1=AESUtil.decrypt(random, companyTotalInsuranceFund);
                list.get(i).setCompanyTotalInsuranceFund(companyTotalInsuranceFund1);
            }
            if (!Check.isNullStr(companyEndowment)){
                String companyEndowment1=AESUtil.decrypt(random, companyEndowment);
                list.get(i).setCompanyEndowment(companyEndowment1);
            }
            if (!Check.isNullStr(companyMedicalInsurance)){
                String companyMedicalInsurance1=AESUtil.decrypt(random, companyMedicalInsurance);
                list.get(i).setCompanyMedicalInsurance(companyMedicalInsurance1);
            }
            if (!Check.isNullStr(companyUnemployedInsurance)){
                String companyUnemployedInsurance1=AESUtil.decrypt(random, companyUnemployedInsurance);
                list.get(i).setCompanyUnemployedInsurance(companyUnemployedInsurance1);
            }
            if (!Check.isNullStr(companyWoundInsurance)){
                String companyWoundInsurance1=AESUtil.decrypt(random, companyWoundInsurance);
                list.get(i).setCompanyWoundInsurance(companyWoundInsurance1);
            }
            if (!Check.isNullStr(companyMaternityInsurance)){
                String companyMaternityInsurance1=AESUtil.decrypt(random, companyMaternityInsurance);
                list.get(i).setCompanyMaternityInsurance(companyMaternityInsurance1);
            }
            if (!Check.isNullStr(companyAccumulationFund)){
                String companyAccumulationFund1=AESUtil.decrypt(random, companyAccumulationFund);
                list.get(i).setCompanyAccumulationFund(companyAccumulationFund1);
            }
            if (!Check.isNullStr(companyMajorDiseaseRisk)){
                String companyMajorDiseaseRisk1=AESUtil.decrypt(random, companyMajorDiseaseRisk);
                list.get(i).setCompanyMajorDiseaseRisk(companyMajorDiseaseRisk1);
            }
            if (!Check.isNullStr(personalTotalInsuranceFund)){
                String personalTotalInsuranceFund1=AESUtil.decrypt(random, personalTotalInsuranceFund);
                list.get(i).setPersonalTotalInsuranceFund(personalTotalInsuranceFund1);
            }
            if (!Check.isNullStr(personalEndowment)){
                String personalEndowment1=AESUtil.decrypt(random, personalEndowment);
                list.get(i).setPersonalEndowment(personalEndowment1);
            }
            if (!Check.isNullStr(personalMedicalInsurance)){
                String personalMedicalInsurance1=AESUtil.decrypt(random, personalMedicalInsurance);
                list.get(i).setPersonalMedicalInsurance(personalMedicalInsurance1);
            }
            if (!Check.isNullStr(personalUnemployedInsurance)){
                String personalUnemployedInsurance1=AESUtil.decrypt(random, personalUnemployedInsurance);
                list.get(i).setPersonalUnemployedInsurance(personalUnemployedInsurance1);
            }
            if (!Check.isNullStr(personalAccumulationFund)){
                String personalAccumulationFund1=AESUtil.decrypt(random, personalAccumulationFund);
                list.get(i).setPersonalAccumulationFund(personalAccumulationFund1);
            }
            if (!Check.isNullStr(personalMajorDiseaseRisk)){
                String personalMajorDiseaseRisk1=AESUtil.decrypt(random, personalMajorDiseaseRisk);
                list.get(i).setPersonalMajorDiseaseRisk(personalMajorDiseaseRisk1);
            }
            if (!Check.isNullStr(paidAward)){
                String paidAward1=AESUtil.decrypt(random, paidAward);
                list.get(i).setPaidAward(paidAward1);
            }
            if (!Check.isNullStr(specialDeductionOfPersonalIncomeTax)){
                String specialDeductionOfPersonalIncomeTax1=AESUtil.decrypt(random, specialDeductionOfPersonalIncomeTax);
                list.get(i).setSpecialDeductionOfPersonalIncomeTax(specialDeductionOfPersonalIncomeTax1);
            }
            if (!Check.isNullStr(taxableAmount)){
                String taxableAmount1=AESUtil.decrypt(random, taxableAmount);
                list.get(i).setTaxableAmount(taxableAmount1);
            }
            if (!Check.isNullStr(personalTax)){
                String personalTax1=AESUtil.decrypt(random, personalTax);
                list.get(i).setPersonalTax(personalTax1);
            }
            if (!Check.isNullStr(actualPaidSalary)){
                String actualPaidSalary1=AESUtil.decrypt(random,actualPaidSalary);
                list.get(i).setActualPaidSalary(actualPaidSalary1);
            }
            if (!Check.isNullStr(overtimePay)){
                String overtimePay1 = AESUtil.decrypt(random,overtimePay);
                list.get(i).setOvertimePay(overtimePay1);
            }
            if (!Check.isNullStr(deductionAmount)){
                String overtimePay1 = AESUtil.decrypt(random, deductionAmount);
                list.get(i).setDeductionAmount(overtimePay1);
            }


            System.out.println(list.get(i).getActualPaidSalary());
            System.out.println(list.get(i).getUserName()+list.get(i).getAgreedSalary()+list.get(i).getAwardSalary()+list.get(i).getOrgName());
        }
		return new ResponseEntity<>(ResponseDto.responseOK(pag), HttpStatus.OK);
	}

    /**
     * 验证二次密码
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(method = RequestMethod.POST,value = "/msalaryPassword")
    public ResponseEntity<ResponseDto> logintest(HttpServletRequest request){
        String logJson = request.getParameter("request_json");
        UserRequest userRequest = (UserRequest)JsonEntityTransform.json2Object(logJson, UserRequest.class);
        String salaryPassword=userRequest.getSalaryPassword();
        if (salaryPassword == null) {
            return new ResponseEntity<>(ResponseDto.responseFail("密码不能为空"), HttpStatus.OK);
        }
        String salaryPassword1=AESUtil.encrypt(salaryPassword);
        TabCoreUserEntity coreUserEntity =userService.getUserInfoByUserId(userRequest.getUserId());
        String salaryPassword2=coreUserEntity.getSalaryPassword();
        if (salaryPassword2.equals(salaryPassword1)) {
            return new ResponseEntity<>(ResponseDto.responseOK("验证通过"), HttpStatus.OK);
        }
        return new ResponseEntity<>(ResponseDto.responseFail("密码错误"), HttpStatus.OK);
    }

    /**
     * 修改工资条密码
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(method = RequestMethod.POST, value = "/mmodifySalaryPassword")
    public ResponseEntity<ResponseDto> mmodifySalaryPassword(HttpServletRequest request) {
        UserRequest userRequest = this.getJsonToTaskRequest(request);
        //判断密码是否一致
        if("".equals(userRequest.getSalaryPassword())){
            return new ResponseEntity<>(ResponseDto.responseFail("新密码不能为空"), HttpStatus.OK);
        }

        TabCoreUserEntity coreUser = userService.getUserInfoByUserId(userRequest.getUserId());
        String salaryPassword = AESUtil.encrypt(userRequest.getSalaryPassword());
        String oldSalaryPassword = AESUtil.encrypt(userRequest.getOldSalaryPassword());
        if(!oldSalaryPassword.equals(coreUser.getSalaryPassword())){
            return new ResponseEntity<>(ResponseDto.responseFail("旧密码输入错误"),HttpStatus.OK);
        }

        if(!userRequest.getConfirmSalaryPassword().equals(userRequest.getSalaryPassword())){
            return new ResponseEntity<>(ResponseDto.responseFail("两次密码不一致"), HttpStatus.OK);
        }
        if (userRequest.getConfirmSalaryPassword().equals("12345678")){
            return new ResponseEntity<>(ResponseDto.responseFail("密码不能设置为初始密码"), HttpStatus.OK);
        }

        String defaultPwd= GlobalsUtils.getValue("DEFAULT_SPWD");
        if(!Check.isNullStr(salaryPassword)&&salaryPassword.equals(defaultPwd))
        {
            return new ResponseEntity<>(ResponseDto.responseFail("新密码不能设置为初始密码"), HttpStatus.OK);
        }

        coreUser.setSalaryPassword(salaryPassword);
        coreUser.setLastModifyId(userRequest.getLastModifyId());
        coreUser.setLastModifyTime(new Date());
        int num = userService.updateUserInfoById(coreUser,userRequest.getRoleId());
        if (num > 0) {
            return new ResponseEntity<>(ResponseDto.responseOK("success"), HttpStatus.OK);
        }
        return new ResponseEntity<>(ResponseDto.responseFail("failed"), HttpStatus.OK);
    }

    private UserRequest getJsonToTaskRequest(HttpServletRequest request){
        String logJson = request.getParameter("request_json");
        UserRequest userRequest = (UserRequest)JsonEntityTransform.json2Object(logJson, UserRequest.class);
        return userRequest;
    }

    /*
    @ResponseBody
    @RequestMapping(value = "/getSalaryInfoBySalaryMonth")
    public PagingResult<TabCoreUserSalaryEntity> getSalaryInfoBySalaryMonth(HttpServletRequest req, String request_json){
        UserSalaryRequest request = JsonEntityTransform.json2Object(request_json, UserSalaryRequest.class);
//        request.setLimit(10);
        TabCoreUserEntity coreUserEntity=userService.getUserInfoByUserId(request.getUserId());
        String salarySecretKey=coreUserEntity.getSalarySecretKey();
        String random=AESUtil.decrypt(salarySecretKey);

        String salaryMonthAES=AESUtil.encrypt(random,request.getSalaryMonth());
        request.setSalaryMonth(salaryMonthAES);
        String userCertificateNoAES=AESUtil.encrypt(random,coreUserEntity.getUserCertificateNo());
        request.setUserCertificateNo(userCertificateNoAES);
        PagingResult<TabCoreUserSalaryEntity> pag = userSalaryService.findForPage(request);

        List<TabCoreUserSalaryEntity> list=pag.getRows();
        for (int i=0;i<list.size();i++){
            String userCertificateNo=list.get(i).getUserCertificateNo();
            String salaryMonth=list.get(i).getSalaryMonth();
            String entryDate=list.get(i).getEntryDate();
            String positionSalary=list.get(i).getPositionSalary();
            String meritSalary=list.get(i).getMeritSalary();
            String positionAllowance=list.get(i).getPositionAllowance();
            String awardSalary=list.get(i).getAwardSalary();
            String agreedSalary=list.get(i).getAgreedSalary();
            String computerAllowance=list.get(i).getComputerAllowance();
            String mealAllowance=list.get(i).getMealAllowance();
            String recommendAward=list.get(i).getRecommendAward();
            String evectionAllowance=list.get(i).getEvectionAllowance();
            String reissueSalary=list.get(i).getReissueSalary();
            String overtimeAllowance=list.get(i).getOvertimeAllowance();
            String leaveDeduct=list.get(i).getLeaveDeduct();
            String sunShine=list.get(i).getSunShine();
            String otherAllowance=list.get(i).getOtherAllowance();
            String totalSalary=list.get(i).getTotalSalary();
            String companyTotalInsuranceFund=list.get(i).getCompanyTotalInsuranceFund();
            String companyEndowment=list.get(i).getCompanyEndowment();
            String companyMedicalInsurance=list.get(i).getCompanyMedicalInsurance();
            String companyUnemployedInsurance=list.get(i).getCompanyUnemployedInsurance();
            String companyWoundInsurance=list.get(i).getCompanyWoundInsurance();
            String companyMaternityInsurance=list.get(i).getCompanyMaternityInsurance();
            String companyAccumulationFund=list.get(i).getCompanyAccumulationFund();
            String personalTotalInsuranceFund=list.get(i).getPersonalTotalInsuranceFund();
            String personalEndowment=list.get(i).getPersonalEndowment();
            String personalMedicalInsurance=list.get(i).getPersonalMedicalInsurance();
            String personalUnemployedInsurance=list.get(i).getPersonalUnemployedInsurance();
            String personalAccumulationFund=list.get(i).getPersonalAccumulationFund();
            String paidAward=list.get(i).getPaidAward();
            String taxableAmount=list.get(i).getTaxableAmount();
            String personalTax=list.get(i).getPersonalTax();
            String actualPaidSalary=list.get(i).getActualPaidSalary();
            //判断非空后解密
            if (!Check.isNullStr(userCertificateNo)){
                String userCertificateNo1=AESUtil.decrypt(random, userCertificateNo);
                list.get(i).setUserCertificateNo(userCertificateNo1);
            }
            if (!Check.isNullStr(salaryMonth)){
                String salaryMonth1=AESUtil.decrypt(random, salaryMonth);
                list.get(i).setSalaryMonth(salaryMonth1);
            }
            if (!Check.isNullStr(entryDate)){
                String entryDate1=AESUtil.decrypt(random, entryDate);
                list.get(i).setEntryDate(entryDate1);
            }
            if (!Check.isNullStr(positionSalary)){
                String positionSalary1=AESUtil.decrypt(random, positionSalary);
                list.get(i).setPositionSalary(positionSalary1);
            }
            if (!Check.isNullStr(meritSalary)){
                String meritSalary1=AESUtil.decrypt(random, meritSalary);
                list.get(i).setMeritSalary(meritSalary1);
            }
            if (!Check.isNullStr(positionAllowance)){
                String positionAllowance1=AESUtil.decrypt(random, positionAllowance);
                list.get(i).setPositionAllowance(positionAllowance1);
            }
            if (!Check.isNullStr(awardSalary)){
                String awardSalary1=AESUtil.decrypt(random, awardSalary);
                list.get(i).setAwardSalary(awardSalary1);
            }
            if (!Check.isNullStr(agreedSalary)){
                String agreedSalary1=AESUtil.decrypt(random, agreedSalary);
                list.get(i).setAgreedSalary(agreedSalary1);
            }
            if (!Check.isNullStr(computerAllowance)){
                String computerAllowance1=AESUtil.decrypt(random, computerAllowance);
                list.get(i).setComputerAllowance(computerAllowance1);
            }
            if (!Check.isNullStr(mealAllowance)){
                String mealAllowance1=AESUtil.decrypt(random, mealAllowance);
                list.get(i).setMealAllowance(mealAllowance1);
            }
            if (!Check.isNullStr(recommendAward)){
                String recommendAward1=AESUtil.decrypt(random, recommendAward);
                list.get(i).setRecommendAward(recommendAward1);
            }
            if (!Check.isNullStr(evectionAllowance)){
                String evectionAllowance1=AESUtil.decrypt(random, evectionAllowance);
                list.get(i).setEvectionAllowance(evectionAllowance1);
            }
            if (!Check.isNullStr(reissueSalary)){
                String reissueSalary1=AESUtil.decrypt(random, reissueSalary);
                list.get(i).setReissueSalary(reissueSalary1);
            }
            if (!Check.isNullStr(overtimeAllowance)){
                String overtimeAllowance1=AESUtil.decrypt(random, overtimeAllowance);
                list.get(i).setOvertimeAllowance(overtimeAllowance1);
            }
            if (!Check.isNullStr(leaveDeduct)){
                String leaveDeduct1=AESUtil.decrypt(random, leaveDeduct);
                list.get(i).setLeaveDeduct(leaveDeduct1);
            }
            if (!Check.isNullStr(sunShine)){
                String sunShine1=AESUtil.decrypt(random, sunShine);
                list.get(i).setSunShine(sunShine1);
            }
            if (!Check.isNullStr(otherAllowance)){
                String otherAllowance1=AESUtil.decrypt(random, otherAllowance);
                list.get(i).setOtherAllowance(otherAllowance1);
            }
            if (!Check.isNullStr(totalSalary)){
                String totalSalary1=AESUtil.decrypt(random, totalSalary);
                list.get(i).setTotalSalary(totalSalary1);
            }
            if (!Check.isNullStr(companyTotalInsuranceFund)){
                String companyTotalInsuranceFund1=AESUtil.decrypt(random, companyTotalInsuranceFund);
                list.get(i).setCompanyTotalInsuranceFund(companyTotalInsuranceFund1);
            }
            if (!Check.isNullStr(companyEndowment)){
                String companyEndowment1=AESUtil.decrypt(random, companyEndowment);
                list.get(i).setCompanyEndowment(companyEndowment1);
            }
            if (!Check.isNullStr(companyMedicalInsurance)){
                String companyMedicalInsurance1=AESUtil.decrypt(random, companyMedicalInsurance);
                list.get(i).setCompanyMedicalInsurance(companyMedicalInsurance1);
            }
            if (!Check.isNullStr(companyUnemployedInsurance)){
                String companyUnemployedInsurance1=AESUtil.decrypt(random, companyUnemployedInsurance);
                list.get(i).setCompanyUnemployedInsurance(companyUnemployedInsurance1);
            }
            if (!Check.isNullStr(companyWoundInsurance)){
                String companyWoundInsurance1=AESUtil.decrypt(random, companyWoundInsurance);
                list.get(i).setCompanyWoundInsurance(companyWoundInsurance1);
            }
            if (!Check.isNullStr(companyMaternityInsurance)){
                String companyMaternityInsurance1=AESUtil.decrypt(random, companyMaternityInsurance);
                list.get(i).setCompanyMaternityInsurance(companyMaternityInsurance1);
            }
            if (!Check.isNullStr(companyAccumulationFund)){
                String companyAccumulationFund1=AESUtil.decrypt(random, companyAccumulationFund);
                list.get(i).setCompanyAccumulationFund(companyAccumulationFund1);
            }
            if (!Check.isNullStr(personalTotalInsuranceFund)){
                String personalTotalInsuranceFund1=AESUtil.decrypt(random, personalTotalInsuranceFund);
                list.get(i).setPersonalTotalInsuranceFund(personalTotalInsuranceFund1);
            }
            if (!Check.isNullStr(personalEndowment)){
                String personalEndowment1=AESUtil.decrypt(random, personalEndowment);
                list.get(i).setPersonalEndowment(personalEndowment1);
            }
            if (!Check.isNullStr(personalMedicalInsurance)){
                String personalMedicalInsurance1=AESUtil.decrypt(random, personalMedicalInsurance);
                list.get(i).setPersonalMedicalInsurance(personalMedicalInsurance1);
            }
            if (!Check.isNullStr(personalUnemployedInsurance)){
                String personalUnemployedInsurance1=AESUtil.decrypt(random, personalUnemployedInsurance);
                list.get(i).setPersonalUnemployedInsurance(personalUnemployedInsurance1);
            }
            if (!Check.isNullStr(personalAccumulationFund)){
                String personalAccumulationFund1=AESUtil.decrypt(random, personalAccumulationFund);
                list.get(i).setPersonalAccumulationFund(personalAccumulationFund1);
            }
            if (!Check.isNullStr(paidAward)){
                String paidAward1=AESUtil.decrypt(random, paidAward);
                list.get(i).setPaidAward(paidAward1);
            }
            if (!Check.isNullStr(taxableAmount)){
                String taxableAmount1=AESUtil.decrypt(random, taxableAmount);
                list.get(i).setTaxableAmount(taxableAmount1);
            }
            if (!Check.isNullStr(personalTax)){
                String personalTax1=AESUtil.decrypt(random, personalTax);
                list.get(i).setPersonalTax(personalTax1);
            }
            if (!Check.isNullStr(actualPaidSalary)){
                String actualPaidSalary1=AESUtil.decrypt(random,actualPaidSalary);
                list.get(i).setActualPaidSalary(actualPaidSalary1);
            }
        }
        return pag;
    }*/

}
